<!DOCTYPE html>
<html   xmlns="http://www.w3c.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:p="http://primefaces.org/ui"
        xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head/>
    <h:body>
        <p:dataTable var="car" value="#{carBean.cars}" paginator="true" rows="5">
            <f:facet name="header">
                <h:outputText value="List of cars"/>
            </f:facet>
            <p:column>
                <f:facet name="header">
                    <h:outputText value="Model"/>
                </f:facet>
                <h:outputText value="#{car.model}"/>
            </p:column>
            <p:column>
                <f:facet name="header">
                    <h:outputText value="Year"/>
                </f:facet>
                <h:outputText value="#{car.year}"/>
            </p:column>
            <f:facet name="footer">
                Many cars in here!
            </f:facet>
            
            <p:summaryRow>
                <p:column>abc</p:column>
                <p:column>def</p:column>
            </p:summaryRow>
        </p:dataTable>
        
        <br />
        
        <p:dataTable var="car" value="#{carBean.cars}" scrollable="true" scrollHeight="150" editable="true" stickyHeader="true">
            <f:facet name="header">
                <h:outputText value="List of cars"/>
            </f:facet>
            <p:column>
                <f:facet name="header">
                    <h:outputText value="Model"/>
                </f:facet>
                <h:outputText value="#{car.model}"/>
            </p:column>
            <p:column>
                <f:facet name="header">
                    <h:outputText value="Year"/>
                </f:facet>
                <h:outputText value="#{car.year}"/>
            </p:column>
            
            <p:column headerText="Model">
                <p:cellEditor>
                    <f:facet name="output">
                        <h:outputText value="#{car.model}" />
                    </f:facet>
                    <f:facet name="input">
                        <h:inputText value="#{car.model}"/>
                    </f:facet>
                </p:cellEditor>
            </p:column>
            
            <p:column>
                <p:rowEditor/>
            </p:column>
            
            <p:summaryRow>
                <p:column style="text-align:right">
                    Total:
                </p:column>
                <p:column>
                    Some kind of sum here!
                </p:column>
            </p:summaryRow>
            
            <f:facet name="footer">
                Many cars in here!
            </f:facet>
        </p:dataTable>
    </h:body>
</html>